﻿using Bootstrap.Security;
using System.Collections.Generic;
using System.Data;
using System.Linq;

namespace CpsyWebNew.DataAccess
{
    /// <summary>
    /// 
    /// </summary>
    public static class DictHelper
    {
        internal const string RetrieveCpsyDictsDataKey = "DictHelper-RetrieveCpsyDicts";
        public static string RetrieveTitle()
        {
            var dicts = BootstrapDict.RetrieveDicts();
            return (dicts.Where(d => d.Category == "云心理平台网站设置" && d.Name == "网站标题").FirstOrDefault() ?? new BootstrapDict() { Code = "云心理专家平台" }).Code;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public static string RetrieveFooter()
        {
            var dicts = BootstrapDict.RetrieveDicts();
            return (dicts.Where(d => d.Category == "云心理平台网站设置" && d.Name == "网站页脚").FirstOrDefault() ?? new BootstrapDict() { Code = "版权所有：云心理实验室.技术支持：云心理实验室" }).Code;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public static string RetrieveLogoutUrl()
        {
            var dicts = BootstrapDict.RetrieveDicts();
            return (dicts.Where(d => d.Category == "云心理平台网站设置" && d.Name == "系统注销地址").FirstOrDefault() ?? new BootstrapDict() { Code = "#" }).Code;
        }
    }
}
